using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Expect.Core;
namespace Expect.Documentation.Fixtures
{
    [FixtureHint("The total result of the following must be |*|")]
    public class TheTotalResultOfTheFollowingMustBe : Expect.Core.Fixtures.ColumnFixture
    {
		public int Field1 { get; set;}

		public int Field2 { get; set;}

		public int Field3 { get; set;}

        private int _total;

        private int _expectedTotal;

        public TheTotalResultOfTheFollowingMustBe(int expectedTotal)
        {
            _expectedTotal = expectedTotal;
        }

        public int Result()
        {
            int field = Field1 + Field2 + Field3;
            _total += field;
            return field;
        }

        public override void EndRun()
        {
            base.EndRun();
            Assert.AreEqual(_expectedTotal, _total);
        }
    }
}
